﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Dashboard.aspx.cs" Inherits="Admin_Dashboard" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="../lib/echarts.min.js"></script>


</head>
<body class="GridBody">
     <div id="divErr" runat="server" visible="false" style="font-size:1.5em;color:#f00;padding:50px;"></div>
    <form id="GridForm" runat="server">
        <div class="GridPage">
            <div class="GridToolbar">
                <table class="toolbarTable" cellpadding="0" cellspacing="5">
                    <tr>
                        <td></td>
                        <td>
                            <asp:Button ID='btnTable' OnClick="btnTable_Click" runat='server' Text='数据报表' CssClass="styButton" />
                        </td>
                        <td>
                            <asp:Button ID='btnChart' OnClick="btnChart_Click" runat='server' Text='走势报表' CssClass="styButton" />
                        </td>
                    </tr>
                </table>
            </div>
            <div class="GridSearch">
            </div>
            <%--表格区域--%>
            <div class="GridTable">
                <asp:Repeater ID="rpStatistics" runat="server">
                    <ItemTemplate>
                        <table class="GridView" cellspacing="0" rules="all" border="1" style="width: 100%; border-collapse: collapse; margin-bottom: 20px">
                            <tr class="GridViewRow">
                                <td align="center">总注册人数</td>
                                <td align="center"><%#Eval("TotalUserCount") %></td>
                                <td align="center">总娱购买金额</td>
                                <td align="center"><%#Eval("TotalBuyAmount") %></td>
                            </tr>
                            <tr class="AlternatingRow">
                                <td align="center">总奖金</td>
                                <td align="center"><%#Eval("TotalCashBonus") %></td>
                                <td align="center">总果币</td>
                                <td align="center"><%#Eval("TotalCoinBonus") %></td>
                            </tr>
                            <tr class="AlternatingRow">
                                <td align="center">总使用余额</td>
                                <td align="center"><%#Eval("TatalUseCash") %></td>
                                <td align="center">总使用果币</td>
                                <td align="center"><%#Eval("TotalUseCoin") %></td>
                            </tr>
                            <tr class="AlternatingRow">
                                <td align="center">总充值</td>
                                <td align="center"><%#Eval("TotalRechargeCash") %></td>
                                <td align="center">总提现</td>
                                <td align="center"><%#Eval("TotalGetCash") %></td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:Repeater>




                <asp:GridView ID="gvData" runat="server" AutoGenerateColumns="False" Width="100%" CssClass="GridView">
                    <Columns>
                        <asp:BoundField DataField="cdate" HeaderText="日期" DataFormatString="{0:yyyy-MM-dd}">
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TotalUserCount" HeaderText="总注册人数">
                            <HeaderStyle Width="11%" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TotalBuyAmount" HeaderText="总购买金额" DataFormatString="{0:f2}">
                            <HeaderStyle Width="11%" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TotalCashBonus" HeaderText="总奖金" DataFormatString="{0:f2}">
                            <HeaderStyle Width="11%" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TotalCoinBonus" HeaderText="总果币" DataFormatString="{0:f2}">
                            <HeaderStyle Width="11%" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TatalUseCash" HeaderText="总使用余额" DataFormatString="{0:f2}">
                            <HeaderStyle Width="11%" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TotalUseCoin" HeaderText="总使用果币" DataFormatString="{0:f2}">
                            <HeaderStyle Width="11%" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TotalRechargeCash" HeaderText="总充值" DataFormatString="{0:f2}">
                            <HeaderStyle Width="11%" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TotalGetCash" HeaderText="总提现" DataFormatString="{0:f2}">
                            <HeaderStyle Width="11%" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                    </Columns>
                    <RowStyle CssClass="GridViewRow" />
                    <AlternatingRowStyle CssClass="AlternatingRow" />
                    <SelectedRowStyle CssClass="GridViewRowSelected" />
                    <HeaderStyle CssClass="GridViewHeader" />
                    <FooterStyle CssClass="GridViewRow" />
                </asp:GridView>



                <div id="divChart" visible="false" runat="server">
                    <div id="divchart2" style="height: 300px"></div>
                   <div id="divchart1" style="margin-top: 50px; height: 500px"></div>
                 </div>

            </div>

        </div>






        <script type="text/javascript">
var dom = document.getElementById("divchart1");
var myChart = echarts.init(dom);
option = null;
option = {
    title: {
        text: '日走势图'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data: ['总购买金额', '总奖金', '总果币', '总使用余额', '总使用果币', '总充值', '总提现']
    },
    toolbox: {
        show: true,
        feature: {
            dataZoom: {
                yAxisIndex: 'none'
            },
            dataView: { readOnly: false },
            magicType: { type: ['line', 'bar'] },
            restore: {},
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: [<%=date%>]
    },
    yAxis: {
        type: 'value',
        axisLabel: {
            formatter: '{value}'
        }
    },
    series: [
        {
            name: '总购买金额',
            type: 'line',
            data: [<%=BuyAmount%>]
        },
        {
            name: '总奖金',
            type: 'line',
            data: [<%=CashBonus%>]
        },
        {
            name: '总果币',
            type: 'line',
            data: [<%=CoinBonus%>]
        },
        {
            name: '总使用余额',
            type: 'line',
            data: [<%=UseCash%>]
        },
        {
            name: '总使用果币',
            type: 'line',
            data: [<%=UseCoin%>]
        },
        {
            name: '总充值',
            type: 'line',
            data: [<%=RechargeCash%>]
        },
        {
            name: '总提现',
            type: 'line',
            data: [<%=GetCash%>]
        }
    ]
};


if (option && typeof option === "object") {
    myChart.setOption(option, true);
}


dom = document.getElementById("divchart2");
myChart = echarts.init(dom);
option = null;
option = {
    title: {
        text: '日走势图'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data: ['注册人数']
    },
    toolbox: {
        show: true,
        feature: {
            dataZoom: {
                yAxisIndex: 'none'
            },
            dataView: { readOnly: false },
            magicType: { type: ['line', 'bar'] },
            restore: {},
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: [<%=date%>]
    },
    yAxis: {
        type: 'value',
        axisLabel: {
            formatter: '{value}'
        }
    },
    series: [
        {
            name: '注册人数',
            type: 'line',
            data: [<%=UserCount%>]
        }
    ]
};


if (option && typeof option === "object") {
    myChart.setOption(option, true);
}



        </script>
    </form>
</body>
</html>
